Skip to content

feat: Apple Signin iOS/Android/Web#231

Merged
IronTony merged 6 commits intomainfrom
feat/apple-signin
Mar 28, 2026
Merged

feat: Apple Signin iOS/Android/Web#231
IronTony merged 6 commits intomainfrom
feat/apple-signin

Conversation

@IronTony
Copy link
Copy Markdown
Member

Affected Package(s)

  • @forward-software/react-auth (lib)
  • @forward-software/react-auth-google (packages/google-signin)
  • Examples
  • CI/CD / Repository configuration

New package: @forward-software/react-auth-apple (packages/apple-signin)

Related Issue(s)

None

Motivation

Add Apple Sign-In support to the react-auth ecosystem, following the same adapter pattern used by react-auth-google. This enables apps using @forward-software/react-auth to integrate Sign in with Apple across Web, iOS, and Android with a unified API.

Description of Changes

  • Add new @forward-software/react-auth-apple package (v1.0.0) implementing the AuthClient<AppleAuthTokens, AppleAuthCredentials> interface
  • Implement platform-specific authentication:
    • Web: Apple JS SDK integration with popup/redirect flow support
    • iOS: Native AuthenticationServices framework via Expo module (no external dependencies)
    • Android: OAuth flow via Chrome Custom Tabs (requires backend intermediary for Apple's form-post response)
  • Provide ready-to-use AppleSignInButton components for both web and React Native with customizable appearance
  • Include token persistence with pluggable storage (localStorage, MMKV, AsyncStorage, etc.)
  • Add credential state checking on iOS for token refresh and revocation detection
  • Export low-level Apple JS SDK wrapper (./web/appleid) for custom integrations
  • Add unit tests for both web and native AppleAuthClient implementations
  • Register the new package in release-please-config.json and .release-please-manifest.json

Breaking Changes

None

How to Test

  1. CI Checks: Verify that all automated tests (Vitest) and build steps pass successfully on this PR.
  2. Local Verification (Optional):
    • Run pnpm install to install dependencies.
    • Run pnpm --filter @forward-software/react-auth-apple test to run tests for the new package.
    • Run pnpm --filter @forward-software/react-auth-apple build to verify the build succeeds.
    • Run pnpm --filter @forward-software/react-auth-apple lint to check for linting errors.

Checklist

  • My code follows the project's style guidelines
  • I have added or updated tests to cover the changes
  • I have updated relevant documentation
  • All tests are passing locally
  • CI checks are passing
  • I have reviewed my own code and lock file changes
  • I have checked for any potential security implications
  • I have verified the changes work as expected
  • My commit messages follow Conventional Commits format

Notes for Reviewers

  • This package follows the same structure and patterns as packages/google-signin for consistency.
  • Apple only provides user info (name, email) on the first authorization. Subsequent sign-ins return only the identity token and user ID. Consumers should persist user info server-side after the first login.
  • The Android implementation requires a backend endpoint to handle Apple's form_post response mode and redirect back to the app via deep link. See the README for setup details.
  • iOS uses only system frameworks (AuthenticationServices, CryptoKit), so no additional CocoaPods or native dependencies are needed.

@IronTony IronTony marked this pull request as ready for review March 26, 2026 19:13
@IronTony IronTony requested a review from panz3r as a code owner March 26, 2026 19:13
@panz3r panz3r requested review from Copilot and removed request for panz3r March 26, 2026 23:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new @forward-software/react-auth-apple adapter package to the react-auth ecosystem, providing Apple Sign-In support across Web and React Native (Expo), and registers it for automated releases.

Changes:

  • Added new packages/apple-signin package with web + native AppleAuthClient implementations, button components, and Apple JS SDK wrapper.
  • Added Expo native modules for iOS (Swift) and Android (Kotlin + Custom Tabs).
  • Updated release-please configuration/manifest and lockfile to include the new package.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
release-please-config.json Registers packages/apple-signin for release-please tagging.
.release-please-manifest.json Adds initial version entry for packages/apple-signin.
pnpm-lock.yaml Adds new workspace importer and dependency graph updates for the new package.
packages/apple-signin/package.json Defines the new package metadata, exports, scripts, peers, and dev deps.
packages/apple-signin/README.md Documents installation and usage for web/iOS/Android.
packages/apple-signin/tsconfig.json TypeScript build configuration for the new package.
packages/apple-signin/vitest.config.ts Vitest configuration for the new package tests (jsdom + coverage).
packages/apple-signin/test/test-utils.ts Shared test utilities (mock storage + mock Apple JWTs).
packages/apple-signin/test/AppleAuthClient.web.spec.ts Unit tests for web AppleAuthClient behavior.
packages/apple-signin/test/AppleAuthClient.native.spec.ts Unit tests for native AppleAuthClient behavior (mocked native module).
packages/apple-signin/src/types.ts Shared types/config contracts for credentials/tokens/storage and platform configs.
packages/apple-signin/src/index.ts Web entrypoint exports for the package.
packages/apple-signin/src/index.native.ts React Native entrypoint exports for the package.
packages/apple-signin/src/web/index.ts Web sub-entry exports (client + button).
packages/apple-signin/src/web/appleid.ts Thin loader/wrapper around Apple’s JS SDK (AppleID.auth).
packages/apple-signin/src/web/AppleAuthClient.ts Web AuthClient implementation with persistence + JWT exp parsing.
packages/apple-signin/src/web/AppleSignInButton.tsx Web button component that initializes Apple JS SDK and returns credentials.
packages/apple-signin/src/native/index.ts Native sub-entry exports (client + button + module namespace).
packages/apple-signin/src/native/AppleAuthClient.ts Native AuthClient implementation with persistence and credential-state checks.
packages/apple-signin/src/native/AppleSignInButton.tsx React Native button component calling the native module.
packages/apple-signin/src/native/AppleSignInModule.ts JS wrapper around the Expo native module (requireNativeModule).
packages/apple-signin/expo-module.config.json Expo module registration for Apple/Android native modules.
packages/apple-signin/react-auth-apple.podspec Root podspec for iOS integration.
packages/apple-signin/ios/react-auth-apple.podspec iOS-specific podspec colocated under ios/.
packages/apple-signin/ios/AppleSignInModule.swift iOS Expo module implementing configure/signIn/getCredentialState/signOut.
packages/apple-signin/android/build.gradle Android library build config + dependencies (Custom Tabs).
packages/apple-signin/android/src/main/java/expo/modules/applesignin/AppleSignInModule.kt Android Expo module implementing OAuth flow + callback handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@panz3r
Copy link
Copy Markdown
Member

panz3r commented Mar 27, 2026

@IronTony please update documentation and CI configuration files with the new package identifier as mentioned in the "How to implement or enhance an adapter package" in AGENTS.md file (see here: https://github.com/forwardsoftware/react-auth/blob/main/AGENTS.md#how-to-implement-or-enhance-an-adapter-package).

Also update tsconfig.json to match new values expected after migrating to TS 6 (see PR #234)

@panz3r panz3r assigned panz3r and IronTony and unassigned panz3r Mar 27, 2026
@panz3r panz3r self-requested a review March 27, 2026 09:48
@panz3r panz3r added enhancement New feature or request react-native New features or changes related to React Native/Expo labels Mar 27, 2026
@IronTony IronTony force-pushed the feat/apple-signin branch from 212fee5 to 59e41b9 Compare March 27, 2026 22:39
@panz3r panz3r requested a review from Copilot March 27, 2026 22:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 35 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

panz3r
panz3r previously approved these changes Mar 28, 2026
Copy link
Copy Markdown
Member

@panz3r panz3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🤖

Only thing, can you remove the PLAN.md file now that it has been executed?

dependabot bot and others added 5 commits March 28, 2026 13:38
…group across 1 directory (#217)

fix(deps): bump @vitejs/plugin-react

Bumps the vite group with 1 update in the / directory: [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react).


Updates `@vitejs/plugin-react` from 4.7.0 to 6.0.1
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/plugin-react@6.0.1/packages/plugin-react)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-react"
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: vite
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Introduced  package with a ready-made  implementation and .
- Updated documentation in , , and  to include details about the new adapter.
- Enhanced issue templates and GitHub workflows to accommodate the new package.
- Added support for CSRF protection in the Android OAuth flow and improved error handling in the AppleAuthClient.
- Removed deprecated version 4.0.3 and updated all references to picomatch to version 4.0.4.
- Ensured compatibility with dependencies that rely on picomatch.
- Added platform-specific checks for  in React Native to prevent errors on Android.
- Improved error handling in  to manage token expiry and credential state more effectively.
- Updated  to restrict usage to Android only.
- Minor adjustments to the Apple Sign-In button for better accessibility.
- Enhanced README documentation to reflect these changes.
panz3r
panz3r previously approved these changes Mar 28, 2026
- Added support for  version 15.15.4 in the package.
- Updated  to include  as a dependency and peer dependency.
- Enhanced README documentation to clarify the integration process and usage of the Apple Sign-In button.
- Improved error handling in the Apple Sign-In module to manage sign-in state more effectively.
- Introduced a new  component for better logo rendering in both web and native environments.
@IronTony IronTony merged commit 8f4271f into main Mar 28, 2026
16 checks passed
@IronTony IronTony deleted the feat/apple-signin branch March 28, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request react-native New features or changes related to React Native/Expo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants